import { computed,makeAutoObservable } from "mobx";
import axios from 'axios'
class ListStore{
    list=[1,2,3,4,5]
    channelList=[]
    constructor(){
        makeAutoObservable(this,{
            filterList:computed
        })
    }
    get filterList(){
        return this.list.filter(el=>el>3)
    }
    addList=()=>{
        this.list.push(6,7,8)
    }
    setChannelList=async ()=>{
        const res=await axios.get('http://geek.itheima.net/v1_0/channels') 
        this.channelList = res.data.data.channels
    }
}
export {ListStore}